/*
 * @Descripttion: 
 * @Author: lukasavage
 * @Date: 2021-11-29 21:01:36
 * @LastEditors: lukasavage
 * @LastEditTime: 2021-11-29 21:28:42
 */

import { LOCATION_CHANGE } from './actions'



/**
 * 
 * @param {*} history history对象
 * @returns 返回一个路由reducer纯函数
 */
function connectRouter(history) {
    const initialState = { action: history.action, location: history.location }
    return function (preState = initialState, { type, payload }) {
        if(type === LOCATION_CHANGE) {
            return { ...StaticRange, action: payload.action, location: payload.location }
        }
    }
}

export default connectRouter;